package controllers

import play.api.mvc.{AbstractController, ControllerComponents}
import play.api.routing.JavaScriptReverseRouter

import javax.inject.Inject

/**
 * Created by yz on 10/12/2021
 */
class AppController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {

  def toIndex = Action { implicit request =>
    println("in")
    Ok(views.html.index())
  }


  def javascriptRoutes = Action { implicit request =>
    Ok(
      JavaScriptReverseRouter("jsRoutes")(

        controllers.routes.javascript.DataController.getAll,
        controllers.routes.javascript.DataController.getSelect2Values,
        controllers.routes.javascript.DataController.detailInfoBefore,
        controllers.routes.javascript.DataController.getById,

        controllers.routes.javascript.AnnoController.getJson,
        controllers.routes.javascript.AnnoController.getAll,
        controllers.routes.javascript.AnnoController.getSelect2Values,

        controllers.routes.javascript.GeneController.getAllById,
        controllers.routes.javascript.GeneController.toIndex,
        controllers.routes.javascript.GeneController.getAll,
        controllers.routes.javascript.GeneController.getAllGene,

        controllers.routes.javascript.ToolsController.caps,
        controllers.routes.javascript.ToolsController.searchBefore,


      )
    ).as("text/javascript")

  }


}
